import Vue from "vue"
import {
	install,
	Store
} from 'vuex'

install(Vue)

export default new Store({
	state: {
		user_info: uni.getStorageSync('user_info') || null,
		history_list: uni.getStorageSync('history_list') || [],
		my_label: uni.getStorageSync('my_label') || [],
	},
	mutations: {
		set_user_info(state, user_info) {
			state.user_info = user_info
			uni.setStorageSync('user_info', user_info)
		},
		set_history_list(state, history_list) {
			state.history_list = history_list
			uni.setStorageSync('history_list', history_list)
		},
		set_my_label(state, my_label) {
			state.my_label = my_label
			uni.setStorageSync('my_label', my_label)
		}
	},
	actions: {

	}
})
